function[lhs]=lhs_lp(lhs_t_h,lhs_t_1,hor,tcode)
% Viet Hoang Dinh
% Monash University
% Edited December 2024

%%
for h=0:hor
lhs_t_h_variable=lag(lhs_t_h,-h);
lhs_t_1_variable=lag(lhs_t_1,h);
lhs_t_1_variable_up=lag(lhs_t_1_variable,-h);
if tcode==1 || tcode==4
    lhs(:,:,h+1)=lhs_t_h_variable; %if yt is I(0), then lhs is yt+h
elseif tcode==2 || tcode==5
    lhs(:,:,h+1)=lhs_t_h_variable-lhs_t_1_variable_up; %if yt is I(1), then lhs is yt+h-yt-1
end
end